﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Kokomo.Lexical.Expressions;

namespace Kokomo.PeInspector.Reflection.Disassembly
{
	struct MsilStackEntry
	{
		public Expression Expression { get; private set; }
		public Type ExpressionType { get; private set; }

		public MsilStackEntry(
			Expression expression,
			Type expressionType
			)
			: this()
		{
			if (expression == null) throw new ArgumentNullException("expression");
			if (expressionType == null) throw new ArgumentNullException("expressionType");

			this.Expression = expression;
			this.ExpressionType = expressionType;
		}

		public override string ToString()
		{
			return string.Format("{0}: {1}", this.ExpressionType, this.Expression);
		}
	}
}
